<template>
  <div class="construction" @click="add">
    <img src="@/assets/iconfont/square.png" alt="" srcset="" v-if="!btn">
    <img src="@/assets/iconfont/plus-square.png" alt="" srcset="" v-else>
    <span :class="btn?'A':'B'">{{title}}</span>
  </div>
</template>

<script>
  export default {
    name: 'construction',
    props: {
      title: {
        type: String
      },
      btn:{
        type:Boolean
      },
      color:{
        type:String
      }
    },
    methods:{
      add(){
        this.$emit('addition',true)
      }
    }
  }
</script>

<style lang="scss" scoped>
  .construction{
    display: flex;
    align-items: center;
    margin-left: 76px;
    margin-right: 28px;
    cursor: pointer;
    img{
      width: 24px;
      height: 24px;
      margin-right: 7px;
    }
    .A{
      font-size: 13px;
      font-weight: 400;
      color: #FFF;
      white-space: nowrap;
    }
    .B{
      font-size: 16px;
      font-weight: 400;
      color: #0584FE;
      white-space: nowrap;
    }
  }
  .construction:active{
    opacity: .7;
  }
</style>
